//
//  SLBaseViewController.m
//  StarLight
//
//  Created by 吴涛 on 16/5/9.
//  Copyright © 2016年 Duke.Wu. All rights reserved.
//

#import "SLBaseViewController.h"

@interface SLBaseViewController ()




@end

@implementation SLBaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
  self.view.backgroundColor = [UIColor whiteColor];
  [self.view addSubview:self.naviHeader];
    // Do any additional setup after loading the view.
}

- (void)viewWillAppear:(BOOL)animated{
  [super viewWillAppear:animated];
  [self.tabBarController.navigationController setNavigationBarHidden:YES animated:YES];
}

- (void)viewWillDisappear:(BOOL)animated{
  [super viewWillDisappear:animated];
//  [SVProgressHUD dismiss];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - DZNEmptyDataSetSource,DZNEmptyDataSetDelegate

- (UIColor *)backgroundColorForEmptyDataSet:(UIScrollView *)scrollView{
  return [UIColor defeutBackgroudColor];
}

- (UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView{

  if (self.reach.isReachable) {
    return [UIImage imageNamed:@"empty"];
  }else{
    return [UIImage imageNamed:@"pic"];
  }
  
}

#pragma mark - getter

- (SLBaseNaviHeader *)naviHeader{
  if (!_naviHeader) {
    _naviHeader = [[SLBaseNaviHeader alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 64)];
    _naviHeader.backgroundColor = SLBlackColor;
  }
  return _naviHeader;
}


- (Reachability *)reach{
  if (!_reach) {
    _reach = [Reachability reachabilityWithHostName:@"www.baidu.com"];
    [_reach startNotifier];
  }
  return _reach;
}

- (SLBaseNavigationViewController *)navigation{

    if (!_navigation) {
        _navigation = [SLBaseNavigationViewController new];
    }
    return _navigation;
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
